<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>团购列表 - Powered By ${systemConfig.systemName}</title>
<meta name="Author" content="webmall Team" />
<meta name="Copyright" content="webmall" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<#include "/WEB-INF/template/common/include.ftl">
<link href="${base}/template/shop/css/login.css" rel="stylesheet" type="text/css" />
<link href="${base}/template/shop/css/register.css" rel="stylesheet" type="text/css" />
<link href="${base}/template/webmall/css/groupbuy.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/template/shop/js/login.js"></script>
<script type="text/javascript" src="${base}/template/shop/js/register.js"></script>
<script type="text/javascript" src="${base}/template/shop/js/product.js"></script>

<script type="text/javascript">
$().ready( function() {
	$(".groupbuy .filter ul li.kind a div").click(function () 
	{
		$(".groupbuy .filter ul li.kind a div").each(function() {
			$this = $(this);
			$(this).removeClass("checked");
		})
		$(this).addClass("checked"); 
	});
	$(".groupbuy .filter ul li.price a div").click(function () 
	{
		$(".groupbuy .filter ul li.price a div").each(function() {
			$this = $(this);
			$(this).removeClass("checked");
		})
		$(this).addClass("checked"); 
	});
	
	

	// 必须会员登录才允许的操作，若未登录则显示登录窗口
	$(".groupbuy .body .filter ul li a").click( function(event) {
		var $this = $(this);
		$('#'+$(this).metadata().elementId).val($(this).metadata().value);
		$('#productListForm').submit();
	});
	
})


</script>
</head>

<body class="groupbuy">
<#assign checkedMenuId='402881882ba98cce012ba9d5cd0f0019'/>
	<#include "/WEB-INF/template/shop/groupbuyheader.ftl">
	<div class="body">
		
		<form id="productListForm" action="${base}/shop/groupbuy!list.action" method="post">
			<input type="hidden" id="pageNumber" name="pager.pageNumber" value="${pager.pageNumber}" />
			<input type="hidden" id="skeyword" name="skeyword" value="${skeyword}" />
			<input type="hidden" name="areaId" value="${area.id}" />
			<input type="hidden" id="category" name="groupbuy.category" value="<#if (groupbuy != null && groupbuy.category !=null)>${groupbuy.category}</#if>" />
			<div class="filter" style="width:100%;display:block;">
				<ul>
					<li class="kind">
						<span style="margin-right:20px;">类别：</span>
						<a href="#" class="{elementId:'category',value:''}" onclick="return false;"><div class="<#if (groupbuy == null || groupbuy.category==null)>checked</#if>">全部</div></a>
						<a href="#" class="{elementId:'category',value:'1'}" onclick="return false;"><div class="<#if (groupbuy != null && groupbuy.category=='1')>checked</#if>">餐饮美食</div></a>
						<a href="#" class="{elementId:'category',value:'2'}" onclick="return false;"><div class="<#if (groupbuy != null && groupbuy.category=='2')>checked</#if>">娱乐休闲</div></a>
						<a href="#" class="{elementId:'category',value:'3'}" onclick="return false;"><div class="<#if (groupbuy != null && groupbuy.category=='3')>checked</#if>">生活服务</div></a>
						<a href="#" class="{elementId:'category',value:'4'}" onclick="return false;"><div class="<#if (groupbuy != null && groupbuy.category=='4')>checked</#if>">生鲜果蔬</div></a>
						<a href="#" class="{elementId:'category',value:'5'}" onclick="return false;"><div class="<#if (groupbuy != null && groupbuy.category=='5')>checked</#if>">其他</div></a>
						<div class="bottom"></div>
					</li>
					<li class="price">
						<span style="margin-right:20px;">价格：</span>
						<a href="#" class="{elementId:'skeyword',value:''}" onclick="return false;"><div class="<#if (skeyword == null || skeyword==null)>checked</#if>">全部</div></a>
						<a href="#" class="{elementId:'skeyword',value:'0~1000'}" onclick="return false;"><div class="<#if (skeyword=='0~1000')>checked</#if>">1000以下</div></a>
						<a href="#" class="{elementId:'skeyword',value:'1000~3000'}" onclick="return false;"><div class="<#if (skeyword=='1000~3000')>checked</#if>">1000~3000</div></a>
						<a href="#" class="{elementId:'skeyword',value:'3000~5000'}" onclick="return false;"><div class="<#if (skeyword=='3000~5000')>checked</#if>">3000~5000</div></a>
						<a href="#" class="{elementId:'skeyword',value:'5000~10000'}" onclick="return false;"><div class="<#if (skeyword=='5000~10000')>checked</#if>">5000~10000</div></a>
						<a href="#" class="{elementId:'skeyword',value:'10000~'}" onclick="return false;"><div class="<#if (skeyword=='10000~')>checked</#if>">10000以上</div></a>
						<div class="bottom"></div>
					</li>
				<ul>
			</div>
			
			<!--
			<div class="blank"></div>
			<div class="operateBar">
				<div class="left"></div>
				<div class="middle">
					<span class="separator">&nbsp;</span>
					<select id="orderType" name="orderType">
						<option value="default"<#if orderType == "default"> selected="selected"</#if>>默认排序</option>
						<option value="priceAsc"<#if orderType == "priceAsc"> selected="selected"</#if>>价格从低到高</option>
						<option value="priceDesc"<#if orderType == "priceDesc"> selected="selected"</#if>>价格从高到低</option>
						<option value="dateAsc"<#if orderType == "dateAsc"> selected="selected"</#if>>按上价时间排序</option>
                    </select>
                    <span class="separator">&nbsp;</span>
                   		 显示数量:
					<select name="pager.pageSize" id="pageSize">
						<option value="1" <#if pager.pageSize == 1>selected="selected" </#if>>
							1
						</option>
						<option value="4" <#if pager.pageSize == 4>selected="selected" </#if>>
							4
						</option>
						<option value="60" <#if pager.pageSize == 60>selected="selected" </#if>>
							60
						</option>
						<option value="120" <#if pager.pageSize == 120>selected="selected" </#if>>
							120
						</option>
					</select>
				</div>
				<div class="right"></div>
			</div>
			-->
			<div class="blank"></div>
			<#import "/WEB-INF/template/shop/pager.ftl" as p>
 			<#assign parameterMap = {"orderType": (orderType)!, "viewType": (viewType)!} />
 			<@p.pager pager = pager baseUrl = "/shop/groupbuy!list.action" parameterMap = parameterMap />
			<div class="productPictureList">
				<ul class="productListDetail">
					<#list pager.list as list>
						<li <#if (list_index + 1) % 4 == 0> class="end"</#if>>
							<div class="title">
								<#if (list.name?length < 28)>
									<a href="${base}/shop/groupbuy!info.action?id=${list.id}" alt="${list.name}" target="_blank">${list.name}</a>
								<#else>
									<a href="${base}/shop/groupbuy!info.action?id=${list.id}" alt="${list.name}" target="_blank">${list.name[0..25]}...</a>
								</#if>
							</div>
							<div class="icons">
								<div class="groupbuy_money"></div>
								<div class="groupbuy_card"></div>
							</div>
							
							
							
							<div class="products">
							<a href="${base}/shop/groupbuy!info.action?id=${list.id}" class="productImage" target="_blank">
								<img src="${base}${(list.productImageList[0].thumbnailProductImagePath)!systemConfig.defaultThumbnailProductImagePath}" alt="${list.name}" />
								<span class="productPriceInfo shadow png">
									<span class="origalPrice">原价：<label>${list.product.price}</label></span>
									<span class="discount">折扣：&nbsp;${(list.discount)}折</span>
									<span class="buyPeoples"><#if (list.view ==null)>0<#else>${list.view}</#if>人购买</span>
								</span>
								<#if (list.discount > 5)>
								<div class="groupbuy_side"></div>
								</#if>
							</a>
							
							<div class="bottom">
								<div class="price">${list.price?string(priceCurrencyFormat)}</div>
								<div class="operation">
									<a href="${base}/shop/groupbuy!info.action?id=${list.id}" target="_blank">
									 <input type="button" name="addCartItemButton" <#if list.isOutOfStock> class="saleover"  value="已售完" disabled<#else>  class="view"  value="查看"</#if> hidefocus="true" />
									</a>
								</div>
								
							</div>
							</div>
						</li>
					</#list>
					<#if (pager.list?size == 0)!>
            			<li class="noRecord">非常抱歉，没有找到相关商品！</li>
            		</#if>
				</ul>
				<div class="blank"></div>
     			<link href="${base}/template/shop/css/pager.css" rel="stylesheet" type="text/css" />
     			<#assign parameterMap = {"orderType": (orderType)!, "viewType": (viewType)!} />
     			<@p.pager pager = pager baseUrl = "/shop/groupbuy!list.action" parameterMap = parameterMap />
			</div>
		</form>
	</div>
	<div class="blank"></div>
	<#include "/WEB-INF/template/shop/footer.ftl">
</body>
</html>
